Encoding dynamic haptic effects

ABSTRACT

A system is provided that encodes one or more dynamic haptic effects. The system defines a dynamic haptic effect as including a plurality of key frames, where each key frame includes an interpolant value and a corresponding haptic effect. An interpolant value is a value that specifies where an interpolation occurs. The system generates a haptic effect file, and stores the dynamic haptic effect within the haptic effect file.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of application Ser. No. 14/574,957,filed on Dec. 18, 2014, the specification of which is herebyincorporated by reference. U.S. patent application Ser. No. 14/574,957is a continuation U.S. patent application Ser. No. 13/667,003, filed onNov. 2, 2012, which issued as U.S. Pat. No. 8,947,216 on Feb. 3, 2015,the specification of which is also hereby incorporated by reference.

FIELD

One embodiment is directed generally to haptic effects, and moreparticularly, to encoding dynamic haptic effects.

BACKGROUND

Electronic device manufacturers strive to produce a rich interface forusers. Conventional devices use visual and auditory cues to providefeedback to a user. In some interface devices, kinesthetic feedback(such as active and resistive force feedback) and/or tactile feedback(such as vibration, texture, and heat) is also provided to the user,more generally known collectively as “haptic feedback” or “hapticeffects.” Haptic feedback can provide cues that enhance and simplify theuser interface. Specifically, vibration effects, or vibrotactile hapticeffects, may be useful in providing cues to users of electronic devicesto alert the user to specific events, or provide realistic feedback tocreate greater sensory immersion within a simulated or virtualenvironment.

Haptic feedback has also been increasingly incorporated in portableelectronic devices, referred to as “handheld devices” or “portabledevices,” such as cellular telephones, personal digital assistants(“PDA's”), smartphones, and portable gaming devices. For example, someportable gaming applications are capable of vibrating in a mannersimilar to control devices (e.g., joysticks, etc.) used withlarger-scale gaming systems that are configured to provide hapticfeedback. Additionally, devices such as cellular telephones andsmartphones are capable of providing various alerts to users by way ofvibrations. For example, a cellular telephone can alert a user to anincoming telephone call by vibrating. Similarly, a smartphone can alerta user to a scheduled calendar item or provide a user with a reminderfor a “to do” list item or calendar appointment. Further, haptic effectscan be used to simulate “real world” dynamic events, such as the feel ofa bouncing ball in a video game.

SUMMARY

One embodiment is a system that encodes a haptic signal. The systemreceives one or more key frames. Each key frame has an interpolant valueand a haptic effect. The system further generates a haptic effect signalusing the one or more key frames. The system further stores the hapticeffect signal within a haptic effect file.

Another embodiment is a system that encodes a dynamic haptic effect. Thesystem defines the dynamic haptic effect as including one or more keyframes. Each key frame includes an interpolant value and a correspondinghaptic effect, where the interpolant value is a value that specifieswhere an interpolation occurs for the corresponding haptic effect. Thesystem further generates a haptic effect file. The system further storesthe dynamic haptic effect within the haptic effect file.

BRIEF DESCRIPTION OF THE DRAWINGS

Further embodiments, details, advantages, and modifications will becomeapparent from the following detailed description of the preferredembodiments, which is to be taken in conjunction with the accompanyingdrawings.

FIG. 1 illustrates a block diagram of a system in accordance with oneembodiment of the invention.

FIG. 2 illustrates an example dynamic haptic effect definition,according to an embodiment of the invention.

FIG. 3 illustrates an example key frame definition, according to anembodiment of the invention.

FIG. 4 illustrates an example basis haptic effect storage block,according to an embodiment of the invention.

FIG. 5 illustrates an example frame list block, according to anembodiment of the invention.

FIG. 6 illustrates a flow diagram of the functionality of a hapticencoding module, according to one embodiment of the invention.

FIG. 7 illustrates a flow diagram of the functionality of a hapticencoding module, according to another embodiment of the invention.

DETAILED DESCRIPTION

As described below, a “dynamic haptic effect” refers to a haptic effectthat evolves over time as it responds to one or more input parameters.Dynamic haptic effects are haptic or vibrotactile effects displayed onhaptic devices to represent a change in state of a given input signal.The input signal can be a signal captured by sensors on the device withhaptic feedback, such as position, acceleration, pressure, orientation,or proximity, or signals captured by other devices and sent to thehaptic device to influence the generation of the haptic effect.

A dynamic effect signal can be any type of signal, but does notnecessarily have to be complex. For example, a dynamic effect signal maybe a simple sine wave that has some property such as phase, frequency,or amplitude that is changing over time or reacting in real timeaccording to a mapping schema which maps an input parameter onto achanging property of the effect signal. An input parameter may be anytype of input capable of being provided by a device, and typically maybe any type of signal such as a device sensor signal. A device sensorsignal may be generated by any means, and typically may be generated bycapturing a user gesture with a device. Dynamic effects may be veryuseful for gesture interfaces, but the use of gestures or sensors arenot necessarily required to create a dynamic signal.

One common scenario that does not involve gestures directly is definingthe dynamic haptic behavior of an animated widget. For example, when auser scrolls a list, it is not typically the haptification of thegesture that will feel most intuitive, but instead the motion of thewidget in response to the gesture. In the scroll list example, gentlysliding the list may generate a dynamic haptic feedback that changesaccording to the speed of the scrolling, but flinging the scroll bar mayproduce dynamic haptics even after the gesture has ended. This createsthe illusion that the widget has some physical properties and itprovides the user with information about the state of the widget such asits velocity or whether it is in motion.

A gesture is any movement of the body that conveys meaning or userintent. It will be recognized that simple gestures may be combined toform more complex gestures. For example, bringing a finger into contactwith a touch sensitive surface may be referred to as a “finger on”gesture, while removing a finger from a touch sensitive surface may bereferred to as a separate “finger off” gesture. If the time between the“finger on” and “finger off” gestures is relatively short, the combinedgesture may be referred to as “tapping”; if the time between the “fingeron” and “finger off” gestures is relatively long, the combined gesturemay be referred to as “long tapping”; if the distance between the twodimensional (x,y) positions of the “finger on” and “finger off” gesturesis relatively large, the combined gesture may be referred to as“swiping”; if the distance between the two dimensional (x,y) positionsof the “finger on” and “finger off” gestures is relatively small, thecombined gesture may be referred to as “smearing”, “smudging” or“flicking”. Any number of two dimensional or three dimensional simple orcomplex gestures may be combined in any manner to form any number ofother gestures, including, but not limited to, multiple finger contacts,palm or fist contact, or proximity to the device. A gesture can also beany form of hand movement recognized by a device having anaccelerometer, gyroscope, or other motion sensor, and converted toelectronic signals. Such electronic signals can activate a dynamiceffect, such as shaking virtual dice, where the sensor captures the userintent that generates a dynamic effect.

One embodiment is a system that can encode one or more dynamic hapticeffects on a disk, memory, or any computer-readable storage medium. Onetype of a dynamic haptic effect is a haptic effect that can be generatedby interpolating a first haptic effect and a second haptic effect basedon a dynamic value that is a value between a first interpolant value anda second interpolant value. A dynamic value that is equal to either thefirst interpolant value or the second interpolant value is considered“between the first interpolant value and the second interpolant value.”More specifically, a value for each parameter of the dynamic hapticeffect is calculated by interpolating a value of the parameter of thefirst haptic effect with a value of the parameter of the second hapticeffect, using an interpolation function. The interpolation of eachparameter value of the dynamic haptic effect can be based upon where thedynamic value falls between the first interpolant value and the secondinterpolant value. Dynamic haptic effects are further described in U.S.patent application Ser. No. 13/546,351, filed on Jul. 11, 2012, entitled“GENERATING HAPTIC EFFECTS FOR DYNAMIC EVENTS” (the contents of whichare herein incorporated by reference). The dynamic haptic effect can beencoded using a haptic effect signal, where the haptic effect signal isa representation of the dynamic haptic effect. The haptic effect signalcan be persisted on a disk, memory, or any computer-readable storagemedium.

According to the embodiment, the system can define each dynamic hapticeffect as one or more key frames, where each key frame can include ahaptic effect, and a corresponding value. Thus, the system can createone or more dynamic haptic effect definitions. The system can store theone or more dynamic haptic effect definitions within a haptic effectfile. The system can further retrieve the one or more dynamic hapticeffect definitions from the haptic effect file. The system can furtherreceive a dynamic value, and, based on the received dynamic value,interpret the one or more dynamic haptic effect definitions in order togenerate the one or more dynamic haptic effects.

According to another embodiment, the system can receive one or more keyframes, where each key frame can include a haptic effect and a value.The system can generate a haptic effect signal using the one or more keyframes. The system can further store the haptic effect signal within ahaptic effect file. The system can further retrieve the haptic effectsignal form the haptic effect file. The system can further apply a drivesignal to a haptic output device according to the haptic effect signal.The system can further generate the drive signal using the haptic outputdevice. In this embodiment, the one or more key frames can comprise theone or more input parameters of a dynamic haptic effect produced by thehaptic effect signal.

FIG. 1 illustrates a block diagram of a system 10 in accordance with oneembodiment of the invention. In one embodiment, system 10 is part of adevice, and system 10 provides a haptic encoding functionality for thedevice. Although shown as a single system, the functionality of system10 can be implemented as a distributed system. System 10 includes a bus12 or other communication mechanism for communicating information, and aprocessor 22 coupled to bus 12 for processing information. Processor 22may be any type of general or specific purpose processor. System 10further includes a memory 14 for storing information and instructions tobe executed by processor 22. Memory 14 can be comprised of anycombination of random access memory (“RAM”), read only memory (“ROM”),static storage such as a magnetic or optical disk, or any other type ofcomputer-readable medium.

A computer-readable medium may be any available medium that can beaccessed by processor 22 and may include both a volatile and nonvolatilemedium, a removable and non-removable medium, a communication medium,and a storage medium. A communication medium may include computerreadable instructions, data structures, program modules or other data ina modulated data signal such as a carrier wave or other transportmechanism, and may include any other form of an information deliverymedium known in the art. A storage medium may include RAM, flash memory,ROM, erasable programmable read-only memory (“EPROM”), electricallyerasable programmable read-only memory (“EEPROM”), registers, hard disk,a removable disk, a compact disk read-only memory (“CD-ROM”), or anyother form of a storage medium known in the art.

In one embodiment, memory 14 stores software modules that providefunctionality when executed by processor 22. The modules include anoperating system 15 that provides operating system functionality forsystem 10, as well as the rest of a mobile device in one embodiment. Themodules further include a haptic encoding module 16 that encodes adynamic haptic effect, as disclosed in more detail below. In certainembodiments, haptic encoding module 16 can comprise a plurality ofmodules, where each individual module provides specific individualfunctionality for encoding a dynamic haptic effect. System 10 willtypically include one or more additional application modules 18 toinclude additional functionality, such as the Integrator™ application byImmersion Corporation.

System 10, in embodiments that transmit and/or receive data from remotesources, further includes a communication device 20, such as a networkinterface card, to provide mobile wireless network communication, suchas infrared, radio, Wi-Fi, or cellular network communication. In otherembodiments, communication device 20 provides a wired networkconnection, such as an Ethernet connection or a modem.

Processor 22 is further coupled via bus 12 to a display 24, such as aLiquid Crystal Display (“LCD”), for displaying a graphicalrepresentation or user interface to a user. The display 24 may be atouch-sensitive input device, such as a touchscreen, configured to sendand receive signals from processor 22, and may be a multi-touchtouchscreen. Processor 22 may be further coupled to a keyboard or cursorcontrol 28 that allows a user to interact with system 10, such as amouse or a stylus.

System 10, in one embodiment, further includes an actuator 26. Processor22 may transmit a haptic signal associated with a generated hapticeffect to actuator 26, which in turn outputs haptic effects such asvibrotactile haptic effects. Actuator 26 includes an actuator drivecircuit. Actuator 26 may be, for example, an electric motor, anelectro-magnetic actuator, a voice coil, a shape memory alloy, anelectro-active polymer, a solenoid, an eccentric rotating mass motor(“ERM”), a linear resonant actuator (“LRA”), a piezoelectric actuator, ahigh bandwidth actuator, an electroactive polymer (“EAP”) actuator, anelectrostatic friction display, or an ultrasonic vibration generator. Inalternate embodiments, system 10 can include one or more additionalactuators, in addition to actuator 26 (not illustrated in FIG. 1). Inother embodiments, a separate device from system 10 includes an actuatorthat generates the haptic effects, and system 10 sends generated hapticeffect signals to that device through communication device 20. Actuator26 is an example of a haptic output device, where a haptic output deviceis a device configured to output haptic effects, such as vibrotactilehaptic effects, in response to a drive signal.

System 10 can further be operatively coupled to a database 30, wheredatabase 30 can be configured to store data used by modules 16 and 18.Database 30 can be an operational database, an analytical database, adata warehouse, a distributed database, an end-user database, anexternal database, a navigational database, an in-memory database, adocument-oriented database, a real-time database, a relational database,an object-oriented database, or any other database known in the art.

FIG. 2 illustrates an example dynamic haptic effect definition 200,according to an embodiment of the invention. According to an embodiment,a dynamic haptic effect can be defined to include one or more keyframes. A key frame is a representation of a basis haptic effect thatcan be used to define the dynamic haptic effect. Also according to anembodiment, a haptic effect signal can be generated using the one ormore key frames, where the haptic effect signal is a signal that canstore one or more key frames. By generating the haptic effect signalusing the one or more key frames, the one or more key frames aregenerated, and subsequently stored within the haptic effect signal. Thehaptic effect signal can be stored within, and retrieved from, a hapticeffect file.

A key frame can include a basis haptic effect definition. A basis hapticeffect is a haptic effect that can include one or more parameters thatdefine the characteristics of the haptic effect (more specifically, thecharacteristics of the kinesthetic feedback and/or tactile feedbackproduced by the haptic effect), where the haptic effect can be avibratory haptic effect, for example. Examples of the one or moreparameters can include a magnitude parameter, a frequency parameter, anda duration parameter. Examples of basis haptic effects can include a“MagSweep haptic effect”, and a “periodic haptic effect.” A MagSweephaptic effect is a haptic effect that produces kinesthetic feedbackand/or tactile feedback (such as a vibration). A periodic haptic effectis a haptic effect that produces a repeating kinesthetic feedback and/ortactile feedback (such as a vibration pattern). An example of arepeating pattern includes repeating pulses of certain shapes, such assinusoidal, rectangular, triangular, sawtooth-up and sawtooth-down.

A key frame can include an interpolant value. An interpolant value is avalue that specifies where a current interpolation is occurring. In anembodiment, an interpolant value can be an integer value from a minimumvalue to a maximum value. As an example, an interpolant value can befrom 0 to 10,000. However, this is merely an example, and an interpolantvalue can be any value from any minimum value to any maximum value. Forexample, in other embodiments, an interpolant value can be a fixed-pointor floating-point numeric value. An interpolant value can be storedwithin one or more bits.

A key frame can optionally also include a repeat gap value. A repeat gapvalue is a value that indicates a time period between two consecutiveinstances of a basis haptic effect when the basis haptic effect isplayed consecutively. In one embodiment, a repeat gap can indicate anumber of milliseconds between two consecutive instances of the basishaptic effect.

In the illustrated embodiment, dynamic haptic effect definition 200includes four key frames, key frames 210, 220, 230, and 240. However,this is merely an example embodiment, and in alternate embodiments, adynamic haptic effect definition can include any number of key frames.Key frame 210 includes a basis haptic effect reference of “Periodic1,”an interpolant value of “0,” and a repeat gap value of “10 ms.” Thebasis haptic effect reference “Periodic1” refers to basis haptic effect260, which is also included within dynamic haptic effect definition 200.Thus, key frame 210 defines basis haptic effect 260 as the basis hapticeffect for the interpolant value of “0.” Key frame 210 further indicatesthat when basis haptic effect 260 is played consecutively, there is atime period of 10 ms between each consecutive instance of basis hapticeffect 260. Similarly, key frame 220 includes a basis haptic effectreference of “Periodic3,” an interpolant value of “10,” and a repeat gapvalue of “15 ms.” The basis haptic effect reference “Periodic3” refersto basis haptic effect 270, which is also included within dynamic hapticeffect definition 200. Thus, key frame 220 defines basis haptic effect270 as the basis haptic effect for the interpolant value of “10.” Keyframe 220 further indicates that when basis haptic effect 270 is playedconsecutively, there is a time period of 15 ms between each consecutiveinstance of basis haptic effect 270.

Likewise, key frame 230 includes a basis haptic effect reference of“Periodic1,” an interpolant value of “20,” and a repeat gap value of “5ms.” As previously described, the basis haptic effect reference“Periodic1” refers to basis haptic effect 260, which is also includedwithin dynamic haptic effect definition 200. Thus, key frame 230 definesbasis haptic effect 260 as the basis haptic effect for the interpolantvalue of “20.” This illustrates that a basis haptic effect can bedefined as a basis haptic effect for more than one interpolant value.Key frame 230 further indicates that when basis haptic effect 260 isplayed consecutively, there is a time period of 5 ms between eachconsecutive instance of basis haptic effect 260. Similarly, key frame240 includes a basis haptic effect reference of “Periodic2,” aninterpolant value of “30,” and a repeat gap value of “20 ms.” The basishaptic effect reference “Periodic2” refers to basis haptic effect 280,which is also included within dynamic haptic effect definition 200.Thus, key frame 240 defines basis haptic effect 280 as the basis hapticeffect for the interpolant value of “30.” Key frame 240 furtherindicates that when basis haptic effect 280 is played consecutively,there is a time period of 20 ms between each consecutive instance ofbasis haptic effect 280.

According to an embodiment, a dynamic haptic effect can be defined toalso include an indication of an end of the dynamic haptic effect. Theindication of the end of the dynamic haptic effect indicates that thedynamic haptic effect does not include any additional key frames. Asdescribed below in greater detail, a device that interprets a dynamichaptic effect definition can be configured to interpret the contents ofthe dynamic haptic effect definition sequentially. Thus, the indicationcan indicate to a device the end of the dynamic haptic effectdefinition. In one embodiment, the indication of an end of the dynamichaptic effect can be considered an additional key frame. In theillustrated embodiment, dynamic haptic effect definition 200 includesend of dynamic haptic effect definition 250 which indicates the end ofdynamic haptic effect definition 200.

FIG. 3 illustrates an example key frame definition 300, according to anembodiment of the invention. As previously described, a dynamic hapticeffect definition includes one or more key frames. According to theembodiment, a key frame definition can include one or more properties.Each property of the one or more properties can include a value.

A key frame definition can include a type property. In one embodiment,the type property is the first property of the key frame definition. Thetype property can indicate whether the key frame is a key frame thatcontains a basis haptic effect for a dynamic haptic effect definition ora key frame that indicates an end of the dynamic haptic effectdefinition. In the illustrated embodiment, key frame definition 300includes type property 310 which indicates the type of key frame definedby key frame definition 300.

A key frame definition can also include a basis haptic effect property.The basis haptic effect property can store a reference to a basis hapticeffect for the key frame. In the illustrated embodiment, key framedefinition 300 includes basis haptic effect property 320 (identified inFIG. 3 as “effect name”) which includes a reference to a basis hapticeffect for the key frame defined by key frame definition 300.

A key frame definition can also include an interpolant property. Theinterpolant property can store an interpolant value, where theinterpolant value specifies where a current interpolation is occurring.In an embodiment, an interpolant value can be an integer value from aminimum value to a maximum value. As an example, an interpolant valuecan be from 0 to 10,000. The interpolant value can be stored in one ormore bits. In the illustrated embodiment, key frame definition 300includes interpolant property 330 which includes an interpolant valuefor the key frame defined by key frame definition 300.

A key frame definition can also optionally include a repeat gap property(not illustrated in FIG. 3). The repeat gap property can store a repeatgap value which indicates a time period between two consecutiveinstances of a basis haptic effect for a key frame when the basis hapticeffect is played consecutively. In one embodiment, a repeat gap canindicate a number of milliseconds between two consecutive instances ofthe basis haptic effect for the key frame.

In one embodiment, a haptic effect file is a computer file configured tostore one or more dynamic haptic effects, where the haptic effect filecan be persisted on a disk, memory, or any computer-readable storagemedium. According to the embodiment, a haptic effect file can store oneor more dynamic haptic effect definitions using a basis haptic effectstorage block and a frame list block. A basis haptic effect storageblock can be used to store one or more basis haptic effects that adynamic haptic effect can reference. A frame list block can be used tostore one or more key frame definitions that correspond to a dynamichaptic effect definition. A basis haptic effect storage block and aframe list block are now described in greater detail.

FIG. 4 illustrates an example basis haptic effect storage block 400,according to an embodiment of the invention. As previously described, adynamic haptic effect definition can include one or more basis hapticeffects, where at least one stored basis haptic effect is referenced byat least one key frame of the dynamic haptic definition. In oneembodiment, the one or more basis haptic effects can be stored within abasis haptic effect storage block, such as basis haptic effect storageblock 400, where the basis haptic effect storage block is stored withinthe dynamic haptic effect definition.

According to the embodiment, one or more basis haptic effects can bestored as message streams within basis haptic effect storage block 400.An example messaging format is a “codename z2” protocol messagingformat. In the illustrated embodiment, a basic haptic effect is definedby a SetPeriodic message optionally preceded by a SetPeriodicModifiermessage. Thus, when a basis haptic effect has an associated envelope, aSetPeriodicModifier message can appear before a SetPeriodic message inthe block. Otherwise, only a SetPeriodic message can appear in theblock. Thus, according to the embodiment, a basis haptic effect, asstored in a basis haptic effect storage block (such as basis hapticeffect storage block 400 of FIG. 4) can either take up: (a) 8 bytes ofmemory in a single SetPeriodic message (assuming a default envelope); or(b) 16 bytes of memory in a first SetPeriodicModifier message followedby a subsequent SetPeriodic message.

According to the embodiment, a basis haptic effect storage block (suchas basis haptic effect storage block 400 of FIG. 4) can include one ormore basis haptic effect definitions, where each basis haptic effectdefinition corresponds to a basis haptic effect. The one or more basishaptic effect definitions can be sequential within the basis hapticeffect storage block, and can each be associated with an index.

In the illustrated embodiment, basis haptic effect storage block 400includes five basis haptic effects: Effect0, Effect1, Effect2, Effect3,and Effect4. Effect0 is the first basis haptic effect located in basishaptic effect storage block 400, Effect1 is the second basis hapticeffect located in basis haptic effect storage block 400, Effect2 is thethird basis haptic effect located in basis haptic effect storage block400, Effect3 is the fourth basis haptic effect located in basis hapticeffect storage block 400, and Effect4 is the fifth basis haptic effectlocated in basis haptic effect storage block 400. Each of the five basishaptic effects (i.e., Effect0, Effect1, Effect2, Effect3, and Effect4)includes a basic haptic definition that either includes a singleSetPeriodic message or a combination of a SetPeriodicModifier messageand a SetPeriodic message.

FIG. 5 illustrates an example frame list block 500, according to anembodiment of the invention. As previously described, a dynamic hapticeffect definition can include one or more key frames, where each keyframe can reference a basis haptic effect. In one embodiment, the one ormore key frames can be stored within a frame list block, such as framelist block 500, where the frame list block is stored within the dynamichaptic effect definition.

According to the embodiment, a frame list block, such as frame listblock 500, includes a type property for a first key frame definition.Depending on the type property, the frame list block further includesone or more properties associated with the first key frame definition,such as a basis haptic effect property, an interpolant property, arepeat gap property, or a combination therein. The frame list blockfurther includes a type property for a second key frame definition,which indicates the end of the first key frame definition. Depending onthe type property, the frame list block further includes one or moreproperties associated with the second key frame definition, such as abasis haptic effect property, an interpolant property, a repeat gapproperty, or a combination therein. This continues for each key framedefinition of the frame list block. The frame list block furtherincludes a type property that indicates an end of a dynamic hapticeffect. According to the embodiment, the key frame definitions of theframe list block are in sequential order. In other words, the events ofthe frame list block are processed in the order in which they arelocated within the frame list block.

According to the embodiment, one or more properties of the frame listblock can be encoded using a single header byte, followed by optionaldata bytes. An example encoding scheme of one or more properties of aframe list block is as follows:

Key Frame Type Property Byte # Bits7-0 Meaning 0 0xC1 Type = Key Frame.No data associated with this property.

End of Dynamic Haptic Effect Type Property Byte # Bits7-0 Meaning 0 0xCFType = End of Dynamic Haptic Effect. No data associated with thisproperty.

EffectNameAsOffSetU8 Property Byte # Bits7-0 Meaning 0 0xE0 EffectNameis specified as a memory offset from the base of the basis haptic effectstorage block. 1 OFFSET11_3 The offset from the basis of the basishaptic effect storage block where the 8 or 16-byte haptic effectdefinition can be found. The OFFSET11_3 value can be multiplied by 8 toobtain the actual address offset

InterpolantU16 Property Byte # Bits7-0 Meaning 0 0xE6 Interpolant isstored as a 16-bit unsigned integer 1 TIME15_8 The MSByte of theTimeOffset value 2 TIME7_0 The LSByte of the TimeOffset value

RepeatGapU16 Property Byte # Bits7-0 Meaning 0 0xE2 Repeat gap value isstored in an un-signed 16-bit value, in milliseconds 1 PERIOD15_8 TheMSByte of the value 2 PERIOD7_0 The LSByte of the value

According to the embodiment, the key frame type property and the end ofdynamic haptic effect type property correspond to a type property of akey frame definition, the EffectNameAsOffSetU8 property corresponds to abasis haptic effect property of the key frame definition, theInterpolantU16 property corresponds to an interpolant property of thekey frame definition, and the RepeatGapU16 property corresponds to arepeat gap property of the key frame definition.

In the illustrated embodiment, frame list block 500 includes key framedefinitions 510, 520, and 530. Key frame definitions 510 and 520 areeach a definition for a basis haptic effect key frame. Key framedefinition 530 is an indication of an end of the dynamic haptic effectstored within frame list block. The left column of frame list block 500indicates a byte stream that is found in memory for each of key framedefinitions 510, 520, and 530. The right column of frame list blockindicates a meaning of each property for each of key frame definitions510, 520, and 530.

According to the illustrated embodiment, key frame definition 510includes a key frame type property (“KeyFrame Event” as illustrated inFIG. 5) that indicates a start of key frame definition 510. Key framedefinition 510 further includes a basis haptic effect property(“EffectNameAsOffsetU8” as illustrated in FIG. 5) that stores areference to a basis haptic effect for key frame definition 510, wherethe basis haptic effect property includes a header byte and an offsetbyte. Key frame definition 510 further includes an interpolant property(“InterpolantU16” as illustrated in FIG. 5) that stores an interpolantvalue specifying where a current interpolation is occurring, where theinterpolant property includes a header byte, a most significant bit(“MSB”), and a least significant bit (“LSB”). Key frame definition 510further includes a repeat gap property (“RepeatGapU16” as illustrated inFIG. 5) that stores a repeat gap value which indicates a time periodbetween two consecutive instances of a basis haptic effect for a keyframe, where the repeat gap property includes a header byte, an MSB, andan LSB.

Further, key frame definition 520 also includes a key frame typeproperty (“KeyFrame Event” as illustrated in FIG. 5) that indicates astart of key frame definition 520. Key frame definition 520 furtherincludes a basis haptic effect property (“EffectNameAsOffsetU16” asillustrated in FIG. 5) that stores a reference to a basis haptic effectfor key frame definition 520, where the basis haptic effect propertyincludes a header byte, a basis haptic effect definition MSB, and abasis haptic effect definition LSB. Key frame definition 520 furtherincludes an interpolant property (“InterpolantU16” as illustrated inFIG. 5) that stores an interpolant value specifying where a currentinterpolation is occurring, where the interpolant property includes aheader byte, an MSB, and an LSB. As illustrated in FIG. 5, in contrastto key frame definition 510, key frame definition 520 does not include arepeat gap property. Finally, key frame definition 530 includes an endof dynamic haptic effect type property (“EndofDynamicHapticEffect” asillustrated in FIG. 5) that indicates an end of the dynamic hapticeffect definition.

According to an embodiment, a dynamic haptic effect definition (such asdynamic haptic effect definition 200 of FIG. 2) can be stored within ahaptic effect file. As previously described, a haptic effect file is acomputer file configured to store one or more dynamic haptic effects.The dynamic haptic effect definition can be stored within the hapticeffect file, and the haptic effect file can be persisted within acomputer-readable medium, such as a disk or memory. The dynamic hapticeffect definition can subsequently be retrieved from the haptic effectand interpreted. Based on the interpretation of the dynamic hapticeffect definition, a dynamic haptic effect can be generated byinterpolating a first haptic effect and a second haptic effect based ona dynamic value that is a value between a first interpolant value and asecond interpolant value. More specifically, a value for each parameterof the dynamic haptic effect can be calculated by interpolating a valueof the parameter of the first haptic effect with a value of theparameter of the second haptic effect, using an interpolation function.The interpolation of each parameter value of the dynamic haptic effectcan be based upon where the dynamic value falls between the firstinterpolant value and the second interpolant value. For example, where afirst interpolant value is “0” and a second interpolant value is “100,”a dynamic value of “50” can cause a first haptic effect associated withthe first interpolant value of “0” to be interpolated with a secondhaptic effect associated with the second interpolant value of “100” tocreate the dynamic haptic effect. Each parameter value of the firsthaptic effect can be interpolated with a parameter value of the secondvalue based on an interpolation function, so that the parameter valuesof the dynamic haptic effect are based both on the parameter values ofthe first haptic effect and the parameter values of the second hapticeffect. Additional details regarding generating dynamic haptic effectsare further described in U.S. patent application Ser. No. 13/546,351,filed on Jul. 11, 2012, entitled “GENERATING HAPTIC EFFECTS FOR DYNAMICEVENTS.”

Also according to an embodiment, a dynamic haptic effect definition(such as dynamic haptic effect definition 200 of FIG. 2) can be used togenerate a haptic effect signal, where the haptic effect signal can bestored within a haptic effect file. The haptic effect signal cansubsequently be retrieved from the haptic effect file. Further, a drivesignal can be applied to a haptic output device according to the hapticeffect signal. The drive signal can be further generated using thehaptic output device.

The haptic effect file can have one of many different formats. Incertain embodiments, the haptic effect file can have an extensiblemarkup language (“XML”) format. In certain other embodiments, the hapticeffect file can have a binary format.

One example of a haptic effect file that has an XML format is anImmersion Vibration Source (“IVS”) haptic effect file. An example IVShaptic effect file that includes a dynamic haptic effect definition isprovided below:

<interpolated-effect name=”interpolated-effect-name”>  <key-frameinterpolant=”0” effect=”basis-effect-0-name”  repeat-gap=”0” /> <key-frame interpolant=”0.5” effect=”basis-effect-1-name” repeat-gap=”15” />  <key-frame interpolant=”1”effect=”basis-effect-2-name” /> </interpolated-effect>

In the example IVS haptic effect file provided above, the first tag,<interpolated-effect name> identifies a name of the dynamic hapticeffect that is being stored within the IVS haptic effect file. The nextthree tags in the example IVS haptic effect file are a series of keyframe tags, where each key frame tag represents a key frame of thedynamic haptic effect. Each key frame tag can include two parameters, akey-frame interpolant parameter and an effect parameter. A key-frameinterpolant parameter represents an interpolant value for the key frame.An effect parameter represents a name of a basis haptic effect for thekey frame. Further, each key frame tag can optionally include a thirdparameter, a repeat gap parameter. A repeat gap parameter represents arepeat gap for a key frame. If the key frame tag does not include arepeat gap parameter, then the key frame does not include a repeat gap,which means that the basis haptic effect for the key frame is notrepeated. In the example IVS haptic effect file, the first key frame tagincludes a key-frame interpolant parameter with a value of “0,” aneffect parameter with a value of “basis-effect-0-name,” and a repeat gapparameter with a value of “0.” The second key frame tag includes akey-frame interpolant parameter with a value of “0.5,” an effectparameter with a value of “basis-effect-1-name,” and a repeat gapparameter with a value of “15.” The third key frame tag includes akey-frame interpolant parameter with a value of “1,” and an effectparameter with a value of “basis-effect-2-name,” and does not include arepeat gap parameter. The subsequent tag, “</interpolated-effect>,”identifies the end of the dynamic haptic effect that is being storedwithin the IVS haptic effect file.

According to an embodiment, a device can read an IVS haptic effect file,such as the example IVS haptic effect file provided above, interpret thedynamic haptic effect definition stored within the IVS haptic effectfile, and use the values stored within the IVS haptic effect file togenerate the dynamic haptic effect. For example, the device can providean interpolant value at runtime, and the device can interpret thedynamic haptic effect definition stored within the IVS haptic effectfile, and determine which key frames the interpolant value lies between.The device can then interpolate between the basis haptic effects of thetwo key frames to generate the dynamic haptic effect.

Another example of a haptic effect file that has a binary format is anImmersion Vibration Target (“IVT”) haptic effect file. An example IVThaptic effect file that includes a dynamic haptic effect definition isprovided below.

0xC1, // KeyFrame event for KeyFrame 0 0xE0, // EffectIndexU8 eventproperty 0, // Use Basis effect 0 0xE6, // InterpolantU8 event property0, // Interpolant value for KeyFrame 0. 0xE2, // TimeOffsetMs16 eventproperty. Note: this is optional 50, // Repeat gap for KeyFrame 0, LSB0, // Repeat gap for KeyFrame 0, MSB 0xC1, // KeyFrame event forKeyFrame 1 0xE0, // EffectIndexU8 event property 1, // Use Basis effect1 0xE6, // InterpolantU8 event property 100, // Interpolant value forKeyFrame 1. 0xE2, // TimeOffsetMs16 event property. Note: this isoptional 150, // Repeat gap for KeyFrame 1, LSB 0, // Repeat gap forKeyFrame 1, MSB 0xCF // End event for LERP effect

The example IVT haptic effect file provided above includes two key framedefinitions, where each key frame definition is identified by thehexadecimal number “0xC1.” According to an embodiment, a hexadecimalvalue, such as “0xCy,” where ‘y’ is any non-zero hexadecimal digit, canidentify a start of a key frame that is being stored within the IVThaptic effect file. Further, according to the embodiment, if thehexadecimal value “0xCy,” is the first such hexadecimal value within theIVT haptic effect file, the hexadecimal value can also indicate a startof a dynamic haptic effect that is being stored within the IVT hapticeffect file, where the dynamic haptic effect includes one or more keyframes. In the example IVT haptic effect file provided above, the firstinstance of “0xC1” indicates the start of the stored dynamic hapticeffect, and also indicates the start of the first key frame, “KeyFrame1,” within the stored dynamic haptic effect. Also in the example IVThaptic effect file, the second instance of “0xC1” indicates the start ofthe second key frame, “KeyFrame 2,” within the stored dynamic hapticeffect.

For each key frame, the example IVT haptic effect file further includesdata that defines the key frame. For example, according to anembodiment, the example IVT haptic effect file further includes ahexadecimal value, such as “0xE0” or “0xE1” that identifies a basishaptic effect property for the key frame, and a value for the basishaptic effect property. In the example IVT haptic effect file, for thefirst key frame, the instance of “0xE0” identifies a basis haptic effectproperty for the first key frame, and the value of “0” identifies afirst basis haptic effect for the basis haptic effect property of thefirst key frame. Likewise, for the second key frame, the instance of“0xE0” identifies a basis haptic effect property for the second keyframe, and the value of “1” identifies a second basis haptic effect forthe basis haptic effect property of the second key frame.

As part of the data that defines the key frame, according to theembodiment, the example IVT haptic effect file further includes ahexadecimal value, such as “0xE6” that identifies an interpolantproperty for the key frame, and a value for the interpolant property. Inthe example IVT haptic effect file, for the first key frame, theinstance of “0xE6” identifies an interpolant property for the first keyframe, and the value of “0” identifies an interpolant value for theinterpolant property of the first key frame. Likewise, for the secondkey frame, the instance of “0xE6” identifies an interpolant property forthe second key frame, and the value of “100” identifies an interpolantvalue for the interpolant property of the second key frame.

As part of the data that defines the key frame, according to theembodiment, the example IVT haptic effect file further optionallyincludes a hexadecimal value, such as “0xE2” that identifies a repeatgap property for the key frame, and one or more values for the repeatgap property. In the example IVT haptic effect file, for the first keyframe, the instance of “0xE2” identifies a repeat gap property for thefirst key frame, the value of “50” identifies a “LSB” repeat gap valuefor the repeat gap property of the first key frame, and the value of “0”identifies a “MSB” repeat gap value for the repeat gap property of thefirst key frame. Likewise, for the second key frame, the instance of“0xE2” identifies a repeat gap property for the second key frame, thevalue of “150” identifies an LSB repeat gap value for the repeat gapproperty of the second key frame, and the value of “0” identifies an MSBrepeat gap value for the repeat gap property of the second key frame.

The example IVT haptic effect file further includes a hexadecimal value,such as “0xCF” that identifies the end of the dynamic haptic effect thatis being stored within the IVT haptic effect file. In the example IVThaptic effect file, the instance of “0XCF” identifies the end of thestored dynamic haptic effect.

According to an embodiment, a device can read an IVT haptic effect file,such as the example IVT haptic effect file provided above, interpret thedynamic haptic effect definition stored within the IVT haptic effectfile, and use the values stored within the IVT haptic effect file togenerate the dynamic haptic effect. For example, the device can providean interpolant value at runtime, and the device can interpret thedynamic haptic effect definition stored within the IVT haptic effectfile, and determine which key frames the interpolant value lies between.The device can then interpolate between the basis haptic effects of thetwo key frames to generate the dynamic haptic effect.

In one embodiment, an IVT haptic effect file can include definitions ofother haptic effects, such as basis haptic effects, in addition todefinitions of dynamic haptic effects. For example, an IVT haptic effectfile can include MagSweep haptic effect definitions, periodic hapticeffect definitions, or other types of basis haptic effect definitions,such as a “waveform haptic effect” definition. A “waveform hapticeffect” is a haptic effect that produces feedback based on a specificsignal that results in more precisely controlled feedback. According tothe embodiment, a hexadecimal value can identify a start of a dynamichaptic effect, as compared to a start of a basis haptic effect. Thus,when a device reads an IVT haptic effect file, the device candistinguish a dynamic haptic effect definition from a basis hapticeffect definition.

In an example embodiment, a hexadecimal value, such as “0xF1,” “0xF2,”or “0xFF,” can identify a start of a “timeline haptic effect.” A“timeline haptic effect” can comprise one or more basic haptic effectsthat are scheduled over time. Further, a hexadecimal value, such as“0x20,” “0x30,” “0x40,” and “0x50,” can identify a start of a basishaptic effect, such as, for example, a MagSweep haptic effect, aperiodic haptic effect, or a waveform haptic effect. And further, aspreviously described, a hexadecimal value, such as “0xCy,” where ‘y’ isany non-zero hexadecimal digit can identify a start of a dynamic hapticeffect. Thus, when a device reads an IVT haptic effect file, the devicecan read a hexadecimal value stored within the IVT haptic effect file,and determine whether the defined haptic effect is a dynamic hapticeffect, or some other haptic effect. Example pseudocode for determiningwhether a defined haptic effect is a dynamic haptic effect, or someother haptic effect is provided below.

if (0xF0 == (*p & 0xF0)) {  // We have a Timeline effect } else if (0xC0== (*p & 0xC0)) {  // We have a Dynamic effect } else if (0 == (*p &0x0F)) {  // We have a Basis effect }

However, this example pseudocode is merely an example of code that canimplement the aforementioned functionality, and code that implements thefunctionality could be in other formats, and still be within the scopeof the invention. Further, while two example formats of a haptic effectfile have been described (i.e., an IVS haptic effect file, and an IVThaptic effect file), a haptic effect file could be in a differentformat, and still be within the scope of the invention.

FIG. 6 illustrates a flow diagram of the functionality of a hapticencoding module (such as haptic encoding module 16 of FIG. 1), accordingto one embodiment of the invention. In one embodiment, the functionalityof FIG. 6, as well as the functionality of FIG. 7, are each implementedby software stored in memory or another computer-readable or tangiblemedium, and executed by a processor. In other embodiments, eachfunctionality may be performed by hardware (e.g., through the use of anapplication specific integrated circuit (“ASIC”), a programmable gatearray (“PGA”), a field programmable gate array (“FPGA”), etc.), or anycombination of hardware and software. Furthermore, in alternateembodiments, each functionality may be performed by hardware usinganalog components.

The flow begins and proceeds to 610. At 610, a dynamic haptic effect isdefined as including a first key frame and a second key frame. The firstkey frame includes a first interpolant value and a corresponding firsthaptic effect. The second key frame includes a second interpolant valueand a corresponding second haptic effect. The first interpolant valuecan be a value that specifies where an interpolation occurs for thecorresponding first haptic effect, and the second interpolant value canbe a value that specifies where an interpolation occurs for thecorresponding second haptic effect. The first key frame and the secondkey frame can each include a repeat gap value. The first haptic effectand the second haptic effect can each be a vibratory haptic effect, andcan each include a plurality of parameters. The plurality of parameterscan include a magnitude parameter, a frequency parameter, and a durationparameter. The dynamic haptic effect can be further defined to includean indication of an end of the dynamic haptic effect. The dynamic hapticeffect can be further defined to include a haptic effect storage block,where the first haptic effect and the second haptic effect can be storedwithin the haptic effect storage block. The dynamic haptic effect caninclude additional key frames. In the illustrated embodiment, a dynamichaptic effect can be defined as including two key frames, where each keyframe includes a haptic effect. However, this is only an exampleembodiment, and in alternate embodiments, a dynamic haptic effect can bedefined as including three or more key frames, where each key frameincludes a haptic effect. The flow proceeds to 620.

At 620, a haptic effect file is generated. A format of the haptic effectfile can be a binary format. Alternatively, the format of the hapticeffect file can be an XML format. The flow proceeds to 630.

At 630, the dynamic haptic effect is stored within the haptic effectfile. The dynamic haptic effect can be stored along with one or moreother haptic effects within the haptic effect file. At least one of theother haptic effects can be another dynamic haptic effect. The flowproceeds to 640.

At 640, the dynamic haptic effect is retrieved from the haptic effectfile. A device can read the haptic effect file and retrieve the dynamichaptic effect. Where the haptic effect file includes one or more otherhaptic effects, the device can identify the dynamic haptic effect basedon a value included within the dynamic haptic effect. The flow proceedsto 650.

At 650, the dynamic haptic effect is interpreted. A device can interpretthe dynamic haptic effect by sequentially reading the first key frameand the second key frame included within the dynamic haptic effect.Where the dynamic haptic effect includes additional key frames, thedevice can further interpret the dynamic haptic effect by sequentiallyreading the additional key frames. The device can further interpret thedynamic haptic effect by receiving a dynamic value and selecting twobasis haptic effects stored within the dynamic haptic effect based onthe received dynamic value. The device can further select two basishaptic effects stored within the dynamic haptic effect based on the factthat the received dynamic value falls within two interpolant values thatare stored within the dynamic haptic effect, where the two interpolantvalues corresponds to the two basis haptic effects. The flow proceeds to660.

At 660, the dynamic haptic effect is generated. The dynamic hapticeffect can be generated based on the two selected basis haptic effects.More specifically, the dynamic haptic effect can be generated byinterpolating the two selected basis haptic effects based on thereceived dynamic value. In certain embodiments, a value for eachparameter of the dynamic haptic effect can be calculated byinterpolating a value of the parameter of the first selected basishaptic effect with a value of the parameter of the second selected basishaptic effect, using an interpolation function. The interpolation ofeach parameter value of the dynamic haptic effect can be based uponwhere the received dynamic value falls between the first interpolantvalue that corresponds to the first selected basis haptic effect and thesecond interpolant value that corresponds to the second selected basishaptic effect. In the illustrated embodiment, a dynamic haptic effectcan be generated by interpolating two basis haptic effects. Such aninterpolation can be a linear interpolation. However, this is only anexample embodiment, and in alternate embodiments, a dynamic hapticeffect can be generated by interpolating three or more basis hapticeffects. Such an interpolation can be a spline interpolation, where aspline interpolation is a form of interpolation where an interpolatingfunction is a special type of piecewise polynomial called a spline, andwhere the interpolating function is a function that can map aninterpolant value to a dynamic haptic effect using two or more keyframes. The dynamic haptic effect can further be generated by anactuator. The flow then ends.

FIG. 7 illustrates a flow diagram of the functionality of a hapticencoding module, according to another embodiment of the invention. Theflow begins and proceeds to 710. At 710, a first key frame is received,where the first key frame has a first interpolant value and a firsthaptic effect. The first interpolant value can be a value that specifieswhere an interpolation occurs for the first haptic effect. The first keyframe can include a repeat gap value. The first haptic effect can be avibratory haptic effect, and can include a plurality of parameters. Theplurality of parameters can include a magnitude parameter, a frequencyparameter, and a duration parameter. The flow proceeds to 720.

At 720, a second key frame is received, where the second key frame has asecond interpolant value and a second haptic effect. The secondinterpolant value can be a value that specifies where an interpolationoccurs for the second haptic effect. The second key frame can include arepeat gap value. The second haptic effect can be a vibratory hapticeffect, and can include a plurality of parameters. The plurality ofparameters can include a magnitude parameter, a frequency parameter, anda duration parameter. The flow proceeds to 730.

At 730, a haptic effect signal is generated using the first key frameand the second key frame. The haptic effect signal can further includean indication of an end of the haptic effect signal. The haptic effectsignal can further include a haptic effect storage block, where thefirst haptic effect and the second haptic effect can be stored withinthe haptic effect storage block. The haptic effect signal can furtherinclude additional key frames. In the illustrated embodiment, the hapticeffect signal can be generated using two key frames, where each keyframe includes a haptic effect. However, this is only an exampleembodiment, and in alternate embodiments, a haptic effect can begenerated using three or more key frames, where each key frame includesa haptic effect. The flow proceeds to 740.

At 740, the haptic effect signal is stored within a haptic effect file.A format of the haptic effect file can be a binary format.Alternatively, the format of the haptic effect file can be an XMLformat. The haptic effect signal can be stored along with one or moreother haptic effect signals within the haptic effect file. At least oneof the other haptic effect signals can include two or more key frames.The flow proceeds to 750.

At 750, the haptic effect signal is retrieved from the haptic effectfile. A device can read the haptic effect file and retrieve the hapticeffect signal. Where the haptic effect file includes one or more otherhaptic effect signals, the device can identify the haptic effect signalbased on a value included within the haptic effect signal. The flowproceeds to 760.

At 760, a drive signal is applied to a haptic output device according tothe haptic effect signal. This can cause the haptic output device toproduce a dynamic haptic effect consistent with the haptic effectsignal. The flow proceeds to 770.

At 770, the drive signal is generated using the haptic output device.The flow then ends.

Thus, in one embodiment, a system can be provided that can store one ormore dynamic haptic effects on a disk, memory, or any computer-readablestorage medium. The system can further retrieve the one or more dynamichaptic effects and output the one or more dynamic haptic effects. Adynamic haptic effect can be based on a plurality of haptic effects.Thus, the system can store information regarding a small number ofhaptic effects, yet the system can output hundreds or thousands ofdynamic haptic effects based on the small number of haptic effects. Thiscan save storage space, and allow for a more efficient mechanism forstoring and retrieving dynamic haptic effects. Further, a format of ahaptic effect file that stores the one or more dynamic haptic effectscan be flexible, so that a haptic effect designer is not limited to asmall number of file formats. This allows an effect designer moreflexibility in creating the dynamic haptic effects.

The features, structures, or characteristics of the invention describedthroughout this specification may be combined in any suitable manner inone or more embodiments. For example, the usage of “one embodiment,”“some embodiments,” “certain embodiment,” “certain embodiments,” orother similar language, throughout this specification refers to the factthat a particular feature, structure, or characteristic described inconnection with the embodiment may be included in at least oneembodiment of the present invention. Thus, appearances of the phrases“one embodiment,” “some embodiments,” “a certain embodiment,” “certainembodiments,” or other similar language, throughout this specificationdo not necessarily all refer to the same group of embodiments, and thedescribed features, structures, or characteristics may be combined inany suitable manner in one or more embodiments.

One having ordinary skill in the art will readily understand that theinvention as discussed above may be practiced with steps in a differentorder, and/or with elements in configurations which are different thanthose which are disclosed. Therefore, although the invention has beendescribed based upon these preferred embodiments, it would be apparentto those of skill in the art that certain modifications, variations, andalternative constructions would be apparent, while remaining within thespirit and scope of the invention. In order to determine the metes andbounds of the invention, therefore, reference should be made to theappended claims.

We claim:
 1. A non-transitory computer-readable medium havinginstructions stored thereon that, when executed by a processor, causethe processor to produce a haptic effect, the producing comprising:detecting a user input using a pressure sensor; generating an inputsignal in response to the detection of the user input; displaying a userinterface; and generating the haptic effect based on the input signal,wherein the haptic effect is associated with one or more elements of theuser interface.
 2. The non-transitory computer-readable medium of claim1, wherein a swiping motion is detected by the pressure sensor.
 3. Thenon-transitory computer-readable medium of claim 1, wherein atwo-dimensional motion or three-dimensional motion is detected by thepressure sensor.
 4. The non-transitory computer-readable medium of claim1, wherein the user interface includes a scroll list.
 5. Thenon-transitory computer-readable medium of claim 1, wherein the hapticeffect is retrieved from a haptic effect file, the haptic effectincluding a first key frame and a second key frame, wherein the firstkey frame includes a first interpolant value and a corresponding firsthaptic effect, and the second key frame includes a second interpolantvalue and a corresponding second haptic effect, wherein the firstinterpolant value is a value that specifies where an interpolationoccurs for the corresponding first haptic effect, and wherein the secondinterpolant value is a value that specifies where an interpolationoccurs for the corresponding second haptic effect.
 6. The non-transitorycomputer-readable medium of claim 5, further comprising: generating adynamic haptic effect by interpolating the first haptic effect and thesecond haptic effect.
 7. The non-transitory computer-readable medium ofclaim 1, wherein the generation of the haptic effect includes generatinga drive signal for a haptic output device.
 8. A method of producing ahaptic effect, the method comprising: detecting a user input using apressure sensor; generating an input signal in response to the detectionof the user input; displaying a user interface; and generating thehaptic effect based on the input signal, wherein the haptic effect isassociated with one or more elements of the user interface.
 9. Themethod of claim 8, wherein a swiping motion is detected by the pressuresensor.
 10. The method of claim 8, wherein a two-dimensional motion orthree-dimensional motion is detected by the pressure sensor.
 11. Themethod of claim 8, wherein the user interface includes a scroll list.12. The method of claim 8, wherein the haptic effect is retrieved from ahaptic effect file, the haptic effect including a first key frame and asecond key frame, wherein the first key frame includes a firstinterpolant value and a corresponding first haptic effect, and thesecond key frame includes a second interpolant value and a correspondingsecond haptic effect, wherein the first interpolant value is a valuethat specifies where an interpolation occurs for the corresponding firsthaptic effect, and wherein the second interpolant value is a value thatspecifies where an interpolation occurs for the corresponding secondhaptic effect.
 13. The method of claim 12, further comprising:generating a dynamic haptic effect by interpolating the first hapticeffect and the second haptic effect.
 14. The method of claim 8, whereinthe generation of the haptic effect includes generating a drive signalfor a haptic output device.
 15. A device comprising: a processor; and amemory storing one or more programs for execution by the processor, theone or more programs including instructions for: detecting a user inputusing a pressure sensor; generating an input signal in response to thedetection of the user input; displaying a user interface; and generatingthe haptic effect based on the input signal, wherein the haptic effectis associated with one or more elements of the user interface.
 16. Thedevice according to claim 15, wherein a swiping motion is detected bythe pressure sensor.
 17. The device according to claim 15, wherein atwo-dimensional motion or three-dimensional motion is detected by thepressure sensor.
 18. The device according to claim 15, wherein the userinterface includes a scroll list.
 19. The device according to claim 15,wherein the haptic effect is retrieved from a haptic effect file, thehaptic effect including a first key frame and a second key frame,wherein the first key frame includes a first interpolant value and acorresponding first haptic effect, and the second key frame includes asecond interpolant value and a corresponding second haptic effect,wherein the first interpolant value is a value that specifies where aninterpolation occurs for the corresponding first haptic effect, andwherein the second interpolant value is a value that specifies where aninterpolation occurs for the corresponding second haptic effect.
 20. Thedevice according to claim 19, further comprising: generating a dynamichaptic effect by interpolating the first haptic effect and the secondhaptic effect.